package dal.database;

import java.sql.Connection;
import java.sql.DatabaseMetaData;
import java.sql.DriverManager;
import java.sql.ResultSetMetaData;
import java.sql.Statement;


public class DBUtil {

	private static Connection connection =null;
	
	
	//static Logger log=Logger.getLogger(DBUtil.class);
	
	
	static{
		try {
			
			Class.forName("com.mysql.jdbc.Driver");
			connection=DriverManager.getConnection("jdbc:mysql://localhost:3306/projectplanner","root","");

			//log.info("Connection object has been created");
			
		} catch (Exception e) {
			e.printStackTrace();
			//log.error(e.getMessage()+"  "+ e.getCause() );
		}
	}
	
	private DBUtil(){
		
	}
	
	
	public static Connection getCon(){
		return connection;
	}

	/*
	public static void main(String[] args) {
		try {
			
			Connection con = DBUtil.getCon();
			Statement st=con.createStatement();
			
			DatabaseMetaData rm=con.getMetaData();
			
			System.out.println(rm.getDatabaseProductName());
			
		} catch (Exception e) {
			e.printStackTrace();
			// TODO: handle exception
		}
	}*/
	
}
